package gui.main;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Date;

import gui.TimeLine;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import com.toedter.calendar.JDateChooser;



public class Musor {
	private static JPanel musor;
	private static JDateChooser datum;
	private static JPanel []termek;
	private static TimeLine tml;
	public static JPanel createMusor(){
		musor = new JPanel(null);
		tml = new TimeLine();
		datum = new JDateChooser();
		datum.setDate(new java.util.Date());
		datum.setBounds(0, 0, 265, 20);
		musor.add(datum);
		musor.add(tml.getTimeLine());
		JButton datum_ok = new JButton("Listáz");
		datum_ok.setBounds(270,0,70,30);
		datum_ok.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent arg0) {
				// TODO Auto-generated method stub
				;
				
				tml.GenerateMusor(new java.sql.Date(datum.getDate().getTime()));
			}
			
		});
		JButton newMusor = new JButton("Új műsor");
		newMusor.setBounds(350,0,70,30);
		newMusor.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent arg0) {
				// TODO Auto-generated method stub
				gui.dialogs.musorModositas.CreateMusorLetrehozoDialog();
			}
			
		});
		musor.add(datum_ok);
		musor.add(newMusor);
		return musor;
	}
	public static void regenerate(){
		tml.UpdateMusor();
	}

}
